<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Canbot: code_example.c File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Canbot
   
   </div>
   <div id="projectbrief">TEAM B</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">code_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A Documented file.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="code__example_8c.html#afa99ec4acc4ecb2dc3c2d05da15d0e3f">MAX</a>(a, b)&#160;&#160;&#160;(((a)&gt;(b))?(a):(b))</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A macro that returns the maximum of <em>a</em> and <em>b</em>.  <a href="#afa99ec4acc4ecb2dc3c2d05da15d0e3f"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">typedef unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="code__example_8c.html#ae1e6edbbc26d6fbc71a90190d0266018">UINT32</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A type definition for a .  <a href="#ae1e6edbbc26d6fbc71a90190d0266018"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="code__example_8c.html#a2c4414339f388561554c2deab11a1a07">open</a> (const char *, int)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Opens a file descriptor.  <a href="#a2c4414339f388561554c2deab11a1a07"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="code__example_8c.html#ae152484c890a24e4d9b4980e7b965be0">close</a> (int)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes the file descriptor <em>fd</em>.  <a href="#ae152484c890a24e4d9b4980e7b965be0"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="code__example_8c.html#af2a3ea719b83f672637febdd87c36c36">write</a> (int, const char *, size_t)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes <em>count</em> bytes from <em>buf</em> to the filedescriptor <em>fd</em>.  <a href="#af2a3ea719b83f672637febdd87c36c36"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8f3ccabcba7278d8eeb1e50027c4e052"></a><!-- doxytag: member="code_example.c::sum" ref="a8f3ccabcba7278d8eeb1e50027c4e052" args="(int, int)" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>sum</b> (int, int)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a03998cb17222cac7c3ad7069f17892b6"></a><!-- doxytag: member="code_example.c::sum" ref="a03998cb17222cac7c3ad7069f17892b6" args="(var1, var2)" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>sum</b> (var1, var2)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="code__example_8c.html#ad65a8842cc674e3ddf69355898c0ecbf">errno</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Contains the last error code.  <a href="#ad65a8842cc674e3ddf69355898c0ecbf"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a799f44203647e4c53bdb0386aa95680f"></a><!-- doxytag: member="code_example.c::var1" ref="a799f44203647e4c53bdb0386aa95680f" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>var1</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac0da06d47d79ad4b9fb1c0eaf1118c3f"></a><!-- doxytag: member="code_example.c::var2" ref="ac0da06d47d79ad4b9fb1c0eaf1118c3f" args="" -->
int&#160;</td><td class="memItemRight" valign="bottom"><b>var2</b></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A Documented file. </p>
<p>Details. </p>
</div><hr/><h2>Define Documentation</h2>
<a class="anchor" id="afa99ec4acc4ecb2dc3c2d05da15d0e3f"></a><!-- doxytag: member="code_example.c::MAX" ref="afa99ec4acc4ecb2dc3c2d05da15d0e3f" args="(a, b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="code__example_8c.html#afa99ec4acc4ecb2dc3c2d05da15d0e3f">MAX</a></td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(((a)&gt;(b))?(a):(b))</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>A macro that returns the maximum of <em>a</em> and <em>b</em>. </p>
<p>Details. </p>

</div>
</div>
<hr/><h2>Typedef Documentation</h2>
<a class="anchor" id="ae1e6edbbc26d6fbc71a90190d0266018"></a><!-- doxytag: member="code_example.c::UINT32" ref="ae1e6edbbc26d6fbc71a90190d0266018" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef unsigned int <a class="el" href="code__example_8c.html#ae1e6edbbc26d6fbc71a90190d0266018">UINT32</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>A type definition for a . </p>
<p>Details. </p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ae152484c890a24e4d9b4980e7b965be0"></a><!-- doxytag: member="code_example.c::close" ref="ae152484c890a24e4d9b4980e7b965be0" args="(int)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="code__example_8c.html#ae152484c890a24e4d9b4980e7b965be0">close</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Closes the file descriptor <em>fd</em>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">fd</td><td>The descriptor to close. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2c4414339f388561554c2deab11a1a07"></a><!-- doxytag: member="code_example.c::open" ref="a2c4414339f388561554c2deab11a1a07" args="(const char *, int)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="code__example_8c.html#a2c4414339f388561554c2deab11a1a07">open</a> </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>pathname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Opens a file descriptor. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pathname</td><td>The name of the descriptor. </td></tr>
    <tr><td class="paramname">flags</td><td>Opening flags. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af2a3ea719b83f672637febdd87c36c36"></a><!-- doxytag: member="code_example.c::write" ref="af2a3ea719b83f672637febdd87c36c36" args="(int, const char *, size_t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t <a class="el" href="code__example_8c.html#af2a3ea719b83f672637febdd87c36c36">write</a> </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>fd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Writes <em>count</em> bytes from <em>buf</em> to the filedescriptor <em>fd</em>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">fd</td><td>The descriptor to write to. </td></tr>
    <tr><td class="paramname">buf</td><td>The data buffer to write. </td></tr>
    <tr><td class="paramname">count</td><td>The number of bytes to write. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="ad65a8842cc674e3ddf69355898c0ecbf"></a><!-- doxytag: member="code_example.c::errno" ref="ad65a8842cc674e3ddf69355898c0ecbf" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="code__example_8c.html#ad65a8842cc674e3ddf69355898c0ecbf">errno</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Contains the last error code. </p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>Not thread safe! </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Feb 26 2014 16:20:01 for Canbot by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
